
 <!DOCTYPE HTML>
<html >
<head>
  <meta name="baidu-site-verification" content="gD0cK5v630" />
  <meta charset="UTF-8">
  
    <title>hexo+Jacman+coding/github搭建博客(一) | 陈炳桦博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="陈炳桦">
    

    
    <meta name="description" content="hexo官网https://hexo.io/zh-cn/Jacman主题官网http://wuchong.me/jacman/how-to-use-jacman/修改

安装hexo更新了hexo版本1npm i hexo-cli -g
查看hexo 版本的时候出现问题1hexo version
原因是新版本的hexo目录结构改变了，解决版本是重新写hexo的环境变量:12hexo的环境变量ex">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo+Jacman+coding/github搭建博客(一)">
<meta property="og:url" content="http://chenbinghua.com/2017/03/13/hexo-Jacman-coding-github搭建博客-一/index.html">
<meta property="og:site_name" content="陈炳桦博客">
<meta property="og:description" content="hexo官网https://hexo.io/zh-cn/Jacman主题官网http://wuchong.me/jacman/how-to-use-jacman/修改

安装hexo更新了hexo版本1npm i hexo-cli -g
查看hexo 版本的时候出现问题1hexo version
原因是新版本的hexo目录结构改变了，解决版本是重新写hexo的环境变量:12hexo的环境变量ex">
<meta property="og:updated_time" content="2017-03-28T16:25:10.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="hexo+Jacman+coding/github搭建博客(一)">
<meta name="twitter:description" content="hexo官网https://hexo.io/zh-cn/Jacman主题官网http://wuchong.me/jacman/how-to-use-jacman/修改

安装hexo更新了hexo版本1npm i hexo-cli -g
查看hexo 版本的时候出现问题1hexo version
原因是新版本的hexo目录结构改变了，解决版本是重新写hexo的环境变量:12hexo的环境变量ex">

    
    <link rel="alternative" href="/atom.xml" title="陈炳桦博客" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/jacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
    
    <link rel="stylesheet" href="/css/style.css">
</head>

  <body>
    <header>
      
<div>
		
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="陈炳桦博客">陈炳桦博客</a></h1>
				<h2 class="blog-motto"></h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="菜單">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">主页</a></li>
					
						<li><a href="/archives">归档</a></li>
					
						<li><a href="/about">关于</a></li>
					
						<li><a href="/tags/hexo/">随笔</a></li>
					
						<li><a href="/tags/hexo/">iOS</a></li>
					
						<li><a href="/tags/hexo/">Android</a></li>
					
						<li><a href="/tags/算法/">数据结构与算法</a></li>
					
					
				</ul>
			</nav>			
</div>

    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
  
	<article itemprop="articleBody"> 
		<header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2017/03/13/hexo-Jacman-coding-github搭建博客-一/" title="hexo+Jacman+coding/github搭建博客(一)" itemprop="url">hexo+Jacman+coding/github搭建博客(一)</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="陈炳桦" target="_blank" itemprop="author">陈炳桦</a>
		
  <p class="article-time">
    <time datetime="2017-03-13T10:50:18.000Z" itemprop="datePublished"> 發表於 2017-03-13</time>
    
  </p>
</header>
	<div class="article-content">
		
		<div id="toc" class="toc-article">
			<strong class="toc-title">文章目錄</strong>
		
			<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#安装hexo"><span class="toc-number">1.</span> <span class="toc-text">安装hexo</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#安装Jacman主题-参考Jacman官网"><span class="toc-number">2.</span> <span class="toc-text">安装Jacman主题 参考Jacman官网</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-安装"><span class="toc-number">2.1.</span> <span class="toc-text">1.安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-启用"><span class="toc-number">2.2.</span> <span class="toc-text">2.启用</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-更新-非必要"><span class="toc-number">2.3.</span> <span class="toc-text">3.更新(非必要)</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-部署"><span class="toc-number">2.4.</span> <span class="toc-text">4.部署</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#修改配置文件"><span class="toc-number">3.</span> <span class="toc-text">修改配置文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第一篇文章"><span class="toc-number">4.</span> <span class="toc-text">第一篇文章</span></a></li></ol>
		
		</div>
		
		<blockquote>
<p>hexo官网<a href="https://hexo.io/zh-cn/" target="_blank" rel="external">https://hexo.io/zh-cn/</a><br>Jacman主题官网<a href="http://wuchong.me/jacman/how-to-use-jacman/" target="_blank" rel="external">http://wuchong.me/jacman/how-to-use-jacman/</a><br>修改</p>
</blockquote>
<h2 id="安装hexo"><a href="#安装hexo" class="headerlink" title="安装hexo"></a>安装hexo</h2><p>更新了hexo版本<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm i hexo-cli -g</div></pre></td></tr></table></figure></p>
<p>查看hexo 版本的时候出现问题<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo version</div></pre></td></tr></table></figure></p>
<p>原因是新版本的hexo目录结构改变了，解决版本是重新写hexo的环境变量:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">hexo的环境变量</div><div class="line">export PATH=/usr/local/lib/node_modules/hexo-cli/bin:$PATH</div></pre></td></tr></table></figure></p>
<p>安装完hexo后，安装官网的步骤<br>在桌面新建一个文件夹hexo,在命令行工具中进入该文件夹，然后输入一下命令<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">hexo init hexoblog</div><div class="line">cd hexoblog</div><div class="line">npm install</div></pre></td></tr></table></figure></p>
<p>新建完成后hexoblog文件的目录如下<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line">.</div><div class="line">├── _config.yml</div><div class="line">├── package.json</div><div class="line">├── scaffolds</div><div class="line">├── source</div><div class="line">|   ├── _drafts</div><div class="line">|   └── _posts</div><div class="line">└── themes</div></pre></td></tr></table></figure></p>
<p>在hexoblog目录下执行命令hexo server<br>访问地址<a href="http://localhost:4000/就能得到默认的博客网站" target="_blank" rel="external">http://localhost:4000/就能得到默认的博客网站</a></p>
<h2 id="安装Jacman主题-参考Jacman官网"><a href="#安装Jacman主题-参考Jacman官网" class="headerlink" title="安装Jacman主题 参考Jacman官网"></a>安装Jacman主题 参考Jacman官网</h2><h3 id="1-安装"><a href="#1-安装" class="headerlink" title="1.安装"></a>1.安装</h3><p>在博客根目录下执行如下命令,把Jacman主题下载到博客根目录的themes文件夹<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git clone https://github.com/wuchong/jacman.git themes/jacman</div></pre></td></tr></table></figure></p>
<h3 id="2-启用"><a href="#2-启用" class="headerlink" title="2.启用"></a>2.启用</h3><p>修改你的博客根目录下的_config.yml配置文件中的theme属性，将其设置为jacman。同时建议设置stylus属性中的compress值为true，会自动压缩 CSS 文件，hexo默认配置中不包含这一项，建议开启。如下。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">theme: jacman</div><div class="line">stylus:</div><div class="line">compress: true</div></pre></td></tr></table></figure></p>
<h3 id="3-更新-非必要"><a href="#3-更新-非必要" class="headerlink" title="3.更新(非必要)"></a>3.更新(非必要)</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">cd themes/jacman</div><div class="line">git pull origin master</div></pre></td></tr></table></figure>
<h3 id="4-部署"><a href="#4-部署" class="headerlink" title="4.部署"></a>4.部署</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">hexo deploy</div><div class="line">hexo server</div></pre></td></tr></table></figure>
<h2 id="修改配置文件"><a href="#修改配置文件" class="headerlink" title="修改配置文件"></a>修改配置文件</h2><p>博客根目录下的_config.yml<br>主题配置文件 /themes/主题文件/_comfig.yml</p>
<h2 id="第一篇文章"><a href="#第一篇文章" class="headerlink" title="第一篇文章"></a>第一篇文章</h2>  
	</div>
		<footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/hexo/">hexo</a>
  </div>

</div>



	<div class="article-share" id="share">
	
	  <div data-url="http://chenbinghua.com/2017/03/13/hexo-Jacman-coding-github搭建博客-一/" data-title="hexo+Jacman+coding/github搭建博客(一) | 陈炳桦博客" data-tsina="null" class="share clearfix">
	  </div>
	
	</div>


</footer>

   	       
	</article>
	
<nav class="article-nav clearfix">
 

<div class="next">
<a href="/2017/03/13/iOS博客与网站/"  title="iOS博客与网站">
 <strong>下一篇：</strong><br/> 
 <span>iOS博客与网站
</span>
</a>
</div>

</nav>

	
<section id="comments" class="comment">
	<div class="ds-thread" data-thread-key="2017/03/13/hexo-Jacman-coding-github搭建博客-一/" data-title="hexo+Jacman+coding/github搭建博客(一)" data-url="http://chenbinghua.com/2017/03/13/hexo-Jacman-coding-github搭建博客-一/"></div>
</section>


</div>  
      <div class="openaside"><a class="navbutton" href="#" title="顯示側邊欄"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">文章目錄</strong>
 
 <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#安装hexo"><span class="toc-number">1.</span> <span class="toc-text">安装hexo</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#安装Jacman主题-参考Jacman官网"><span class="toc-number">2.</span> <span class="toc-text">安装Jacman主题 参考Jacman官网</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-安装"><span class="toc-number">2.1.</span> <span class="toc-text">1.安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-启用"><span class="toc-number">2.2.</span> <span class="toc-text">2.启用</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-更新-非必要"><span class="toc-number">2.3.</span> <span class="toc-text">3.更新(非必要)</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-部署"><span class="toc-number">2.4.</span> <span class="toc-text">4.部署</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#修改配置文件"><span class="toc-number">3.</span> <span class="toc-text">修改配置文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第一篇文章"><span class="toc-number">4.</span> <span class="toc-text">第一篇文章</span></a></li></ol>
 
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隱藏側邊欄"></a></div>
<aside class="clearfix">

  


  

  
<div class="tagslist">
	<p class="asidetitle">標簽</p>
		<ul class="clearfix">
		
			
				<li><a href="/tags/算法/" title="算法">算法<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/hexo/" title="hexo">hexo<sup>1</sup></a></li>
			
		
		</ul>
</div>


  


</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	
	<div class="social-font" class="clearfix">
		
		<a href="http://weibo.com/2176287895" target="_blank" class="icon-weibo" title="微博"></a>
		
		
		
		
		
		
		
		
		
		
	</div>
			
		

		<p class="copyright">
		Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Jacman">Jacman</a> © 2017 
		
		<a href="/about" target="_blank" title="陈炳桦">陈炳桦</a>
		
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
  
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else{
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  c.click(function(){
    ta.css('display', 'block').addClass('fadeIn');
  });
  o.click(function(){
    ta.css('display', 'none');
  });
  $(window).scroll(function(){
    ta.css("top",Math.max(140,320-$(this).scrollTop()));
  });
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina'),
      description = $this.attr('description');
  var html = [
  '<div class="hoverqrcode clearfix"></div>',
  '<a class="overlay" id="qrcode"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="微信"></a>',
  '<a href="http://widget.renren.com/dialog/share?resourceUrl=' + encodedUrl + '&srcUrl=' + encodedUrl + '&title=' + title +'" class="article-share-renren" target="_blank" title="人人"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="微博"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);

  $('.hoverqrcode').hide();

  var myWidth = 0;
  function updatehoverqrcode(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
    var qrsize = myWidth > 1024 ? 200:100;
    var options = {render: 'image', size: qrsize, fill: '#2ca6cb', text: url, radius: 0.5, quiet: 1};
    var p = $('.article-share-qrcode').position();
    $('.hoverqrcode').empty().css('width', qrsize).css('height', qrsize)
                          .css('left', p.left-qrsize/2+20).css('top', p.top-qrsize-10)
                          .qrcode(options);
  };
  $(window).resize(function(){
    $('.hoverqrcode').hide();
  });
  $('.article-share-qrcode').click(function(){
    updatehoverqrcode();
    $('.hoverqrcode').toggle();
  });
  $('.article-share-qrcode').hover(function(){}, function(){
      $('.hoverqrcode').hide();
  });
});   
</script>



<script type="text/javascript">
  var duoshuoQuery = {short_name:"chenbinghua"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
    || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 







<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.article-content').each(function(i){
    $(this).find('img').each(function(){
      if ($(this).parent().hasClass('fancybox')) return;
      var alt = this.alt;
      if (alt) $(this).after('<span class="caption">' + alt + '</span>');
      $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
    });
    $(this).find('.fancybox').each(function(){
      $(this).attr('rel', 'article' + i);
    });
  });
  if($.fancybox){
    $('.fancybox').fancybox();
  }
}); 
</script>



<!-- Analytics Begin -->



<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?e6d1f421bbc9962127a50488f9ed37d1";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>



<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="返回頂部"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

<!-- Tiny_search Begin -->

<!-- Tiny_search End -->

<script type="text/javascript">(function(){document.write(unescape('%3Cdiv id="bdcs"%3E%3C/div%3E'));var bdcs = document.createElement('script');bdcs.type = 'text/javascript';bdcs.async = true;bdcs.src = 'http://znsv.baidu.com/customer_search/api/js?sid=4694207588192312952' + '&plate_url=' + encodeURIComponent(window.location.href) + '&t=' + Math.ceil(new Date()/3600000);var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(bdcs, s);})();</script>

  </body>
</html>
